<template>
  <div class="root">
    <!-- 导航栏 -->
    <el-header class="nav">
      <div class="nav__container">
        <div class="nav__content">
          <div class="nav__left">
            <div class="nav__logo">LearnPro</div>
            <el-menu mode="horizontal" :ellipsis="false" class="nav__menu">
              <RouterLink to="/">
                <el-menu-item index="1">首页</el-menu-item>
              </RouterLink>
              <RouterLink to="/honor">
                <el-menu-item index="2">荣誉</el-menu-item>
              </RouterLink>
              <RouterLink to="/study">
                <el-menu-item index="3">学习之路</el-menu-item>
              </RouterLink>
              <RouterLink to="/about">
                <el-menu-item index="4">关于我们</el-menu-item>
              </RouterLink>
            </el-menu>
          </div>
          <div class="nav__right">
            <el-input
              v-model="searchText"
              placeholder="搜索课程"
              class="w-64"
              :prefix-icon="Search"
            />
            <RouterLink to="/login">
              <el-button type="primary" class="!rounded-button whitespace-nowrap">
                登录
              </el-button>
            </RouterLink>
            <RouterLink to="/register/student">
              <el-button type="success" class="!rounded-button whitespace-nowrap">
                注册
              </el-button>
            </RouterLink>
          </div>
        </div>
      </div>
    </el-header>
    <!-- Hero区域 -->
    <div class="hero" :style="{ backgroundImage: `url(${heroImage})` }">
      <div class="hero__gradient">
        <div class="hero__container">
          <div class="hero__content">
            <h1 class="hero__title">打造你的职业未来</h1>
            <p class="hero__description">专业的在线教育平台，助你实现技能提升与职业发展</p>
            <el-button type="primary" size="large" class="!rounded-button whitespace-nowrap">立即开始学习</el-button>
          </div>
        </div>
      </div>
    </div>
    <!-- 核心优势 -->
    <div class="advantages">
      <div class="advantages__container">
        <h2 class="advantages__title">核心优势</h2>
        <el-row :gutter="32">
          <el-col :xs="24" :sm="12" :md="6" v-for="(advantage, index) in advantages" :key="index">
            <el-card class="advantage-card" :body-style="{ padding: '0px' }">
              <div class="advantage-card__image-wrapper">
                <el-image :src="advantage.image" fit="cover" class="advantage-card__image"/>
              </div>
              <div class="advantage-card__content">
                <h3 class="advantage-card__title">{{ advantage.title }}</h3>
                <p class="advantage-card__description">{{ advantage.description }}</p>
              </div>
            </el-card>
          </el-col>
        </el-row>
      </div>
    </div>
    <!-- 精品课程 -->
    <div class="courses">
      <div class="courses__container">
        <h2 class="courses__title">精品课程体系</h2>
        <el-row :gutter="32">
          <el-col :xs="24" :sm="12" :md="8" v-for="course in courses" :key="course.id">
            <el-card class="course-card" :body-style="{ padding: '0px' }">
              <div class="course-card__image-wrapper">
                <el-image :src="course.image" :alt="course.title" fit="cover" class="course-card__image"/>
              </div>
              <div class="course-card__content">
                <h3 class="course-card__title">{{ course.title }}</h3>
                <p class="course-card__description">{{ course.description }}</p>
                <div class="course-card__footer">
                  <span class="course-card__price">¥{{ course.price }}</span>
                  <el-button type="primary" class="!rounded-button whitespace-nowrap">立即报名</el-button>
                </div>
              </div>
            </el-card>
          </el-col>
        </el-row>
      </div>
    </div>
    <!-- 学员就业展示 -->
    <div class="students">
      <div class="max-w-7xl mx-auto px-4">
        <h2 class="courses__title">优秀学员展示</h2>
        <el-row :gutter="32">
          <el-col :xs="24" :sm="12" :md="8" v-for="student in students" :key="student.id">
            <el-card class="hover:shadow-md transition-shadow">
              <div class="flex items-center space-x-4 mb-4">
                <el-avatar :size="64" :src="student.avatar"/>
                <div>
                  <h3 class="text-lg font-bold">{{ student.name }}</h3>
                  <p class="text-gray-600">{{ student.company }}</p>
                </div>
              </div>
              <p class="text-gray-600">{{ student.testimonial }}</p>
            </el-card>
          </el-col>
        </el-row>
      </div>
    </div>
    <el-footer class="custom-footer">
  <div class="footer-container">
    <el-row class="footer-row" :gutter="40">
      <el-col :xs="24" :sm="12" :md="6" class="footer-col">
        <h3 class="footer-title">关于我们</h3>
        <p class="footer-text">我们专注于提供高质量的在线教育服务，帮助学员实现他们的职业理想。我们的课程由行业专家设计，旨在提供最实用的技能和知识。</p>
      </el-col>
      <el-col :xs="24" :sm="12" :md="6" class="footer-col">
        <h3 class="footer-title">联系方式</h3>
        <p class="footer-text">电话：+86 123 4567 8901</p>
        <p class="footer-text">邮箱：contact@learnpro.com</p>
        <p class="footer-text">地址：中国北京市朝阳区</p>
      </el-col>
      <el-col :xs="24" :sm="12" :md="6" class="footer-col">
        <h3 class="footer-title">服务条款</h3>
        <ul class="footer-links">
          <li><el-link type="info" href="#" class="footer-link">隐私政策</el-link></li>
          <li><el-link type="info" href="#" class="footer-link">用户协议</el-link></li>
          <li><el-link type="info" href="#" class="footer-link">退款政策</el-link></li>
        </ul>
      </el-col>
      <el-col :xs="24" :sm="12" :md="6" class="footer-col">
        <h3 class="footer-title">关注我们</h3>
        <div class="footer-social">
          <el-link type="info" href="#" class="footer-social-link">
            <i class="fab fa-weixin footer-social-icon"></i>
          </el-link>
          <el-link type="info" href="#" class="footer-social-link">
            <i class="fab fa-weibo footer-social-icon"></i>
          </el-link>
          <el-link type="info" href="#" class="footer-social-link">
            <i class="fab fa-linkedin footer-social-icon"></i>
          </el-link>
        </div>
      </el-col>
    </el-row>
    <div class="footer-copyright">
      <p class="footer-copyright-text">&copy; 2024 LearnPro. All rights reserved.</p>
    </div>
  </div>
</el-footer>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import { Search } from '@element-plus/icons-vue';
const searchText = ref('');
const heroImage = 'https://ai-public.mastergo.com/ai/img_res/05b282f238b6eb2fc0aab56264897972.jpg';
const advantages = [
  {
    title: '资深讲师团队',
    description: '聚集行业顶尖专家，平均拥有 10 年以上实战经验',
    image: 'https://ai-public.mastergo.com/ai/img_res/36a41cfcdb1a598fac37d36ef37f7f73.jpg'
  },
  {
    title: '实战项目实训',
    description: '真实项目案例，手把手指导，快速提升实战能力',
    image: 'https://ai-public.mastergo.com/ai/img_res/6ea295ed8834fb90c4b89932f4d91cff.jpg'
  },
  {
    title: '一对一辅导',
    description: '专属学习规划，针对性解决学习难点问题',
    image: 'https://ai-public.mastergo.com/ai/img_res/74d463a60644821ed727b4ca31e4ea54.jpg'
  },
  {
    title: '就业保障',
    description: '与 500 强企业深度合作，提供优质就业机会',
    image: 'https://ai-public.mastergo.com/ai/img_res/ba5a899dcdb45f70902f1acee04b5d02.jpg'
  }
];
const courses = [
  {
    id: 1,
    title: 'Web 全栈开发工程师',
    description: '从零基础到全栈开发，完整的职业培训体系',
    price: '15,800',
    image: 'https://ai-public.mastergo.com/ai/img_res/08db4344a348189f18e6c91337db745d.jpg'
  },
  {
    id: 2,
    title: '人工智能算法工程师',
    description: '深度学习、机器学习算法实战课程',
    price: '19,800',
    image: 'https://ai-public.mastergo.com/ai/img_res/214970d71143a36db036bf2f03cad834.jpg'
  },
  {
    id: 3,
    title: '大数据开发工程师',
    description: '大数据处理与分析的综合实战课程',
    price: '17,800',
    image: 'https://ai-public.mastergo.com/ai/img_res/1a80c4268b0fe845443cc8bea8ce776c.jpg'
  }
];
const students = [
  {
    id: 1,
    name: '王晓明',
    company: '腾讯科技 - 高级开发工程师',
    testimonial: '通过系统学习，成功转型为全栈开发工程师，现就职于知名互联网公司，月薪翻倍。',
    avatar: 'https://ai-public.mastergo.com/ai/img_res/c3554a76e499958c61895e947287d9af.jpg'
  },
  {
    id: 2,
    name: '李雪梅',
    company: '阿里巴巴 - 算法工程师',
    testimonial: '零基础开始学习人工智能，现已成为算法团队核心成员，感谢平台的培养。',
    avatar: 'https://ai-public.mastergo.com/ai/img_res/7ab73910b0b8eac3288b4d521867caa5.jpg'
  },
  {
    id: 3,
    name: '张建国',
    company: '字节跳动 - 技术主管',
    testimonial: '在职期间完成进修，技术能力得到显著提升，成功晋升为技术主管。',
    avatar: 'https://ai-public.mastergo.com/ai/img_res/a1518dd63b6e32f74c55a8835f982fce.jpg'
  }
];
const companies = [
  {
    name: '腾讯',
    logo: 'https://ai-public.mastergo.com/ai/img_res/f5f3354261ebed80b54840c09f262aff.jpg'
  },
  {
    name: '阿里巴巴',
    logo: 'https://ai-public.mastergo.com/ai/img_res/3f2c3ea2c5a048d85a44399492b4d137.jpg'
  },
  {
    name: '百度',
    logo: 'https://ai-public.mastergo.com/ai/img_res/928e32f074a2c842b6887dbcbc9b8a7a.jpg'
  },
  {
    name: '字节跳动',
    logo: 'https://ai-public.mastergo.com/ai/img_res/57de8a5c4989bd97fa820d8b7b5f29db.jpg'
  },
  {
    name: '华为',
    logo: 'https://ai-public.mastergo.com/ai/img_res/4ec6a5db4202d91fbe93d96553e5d6e1.jpg'
  }
];
</script>

<style scoped>
.root {
  min-height: 100vh;
  background-color: #fff;
}
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 0;
}
.nav__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
.nav__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}
.nav__left {
  display: flex;
  align-items: center;
}
.nav__logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2563eb;
  margin-right: 2.5rem;
}
.nav__menu {
  border-bottom: none;
}
.nav__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero {
  position: relative;
  height: 600px;
  margin-top: 64px;
  background-size: cover;
  background-position: center;
}
.hero__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(30, 58, 138, 0.9), transparent);
}
.hero__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
}
.hero__content {
  max-width: 36rem;
  color: white;
}
.hero__title {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}
.hero__description {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}
.advantages {
  padding: 5rem 0;
  background-color: #f9fafb;
}
.advantages__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
.advantages__title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 4rem;
}
.advantage-card {
  height: 100%;
  transition: box-shadow 0.3s ease;
}
.advantage-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.advantage-card__image-wrapper {
  width: 100%;
  height: 12rem;
  overflow: hidden;
}
.advantage-card__image {
  width: 100%;
  height: 100%;
  object-position: top;
}
.advantage-card__content {
  padding: 1.5rem;
}
.advantage-card__title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.advantage-card__description {
  color: #6b7280;
}
.courses {
  padding: 5rem 0;
}
.courses__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
.courses__title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 4rem;
}
.course-card {
  height: 100%;
  transition: box-shadow 0.3s ease;
}
.course-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.course-card__image-wrapper {
  height: 12rem;
  overflow: hidden;
}
.course-card__image {
  width: 100%;
  height: 100%;
  object-position: top;
}
.course-card__content {
  padding: 1.5rem;
}
.course-card__title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.course-card__description {
  color: #6b7280;
  margin-bottom: 1rem;
}
.course-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.course-card__price {
  font-size: 1.25rem;
  font-weight: bold;
  color: #2563eb;
}
.custom-footer {
  --el-footer-padding: 0 !important;
  background-color: #2d3748 !important;
  border-top: 3px solid rgba(255, 255, 255, 0.1);
  margin-top: 80px;
}

.footer-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 60px 20px 30px;
  background-color: #2d3748 !important;
}

.footer-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #e2e8f0;
  position: relative;
  padding-bottom: 0.75rem;
}

.footer-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: #4299e1;
}

.footer-text {
  color: #cbd5e0;
  font-size: 0.875rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.footer-link {
  color: #cbd5e0;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}
.footer-link:hover {
  color: #4299e1;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.footer-social-icon {
  font-size: 1.5rem;
  color: #cbd5e0;
  transition: all 0.3s ease;
}
.footer-social-icon:hover {
  color: #4299e1;
  transform: scale(1.1);
}

.footer-copyright {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #4a5568;
}
.footer-copyright-text {
  color: #718096;
  font-size: 0.875rem;
  text-align: center;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .footer-row {
    flex-direction: column;
    gap: 2rem;
  }
  .footer-col {
    width: 100%;
    padding: 0 1rem;
  }
  .footer-title::after {
    width: 30px;
  }
  :deep(.el-menu-item) {
  padding: 0 20px;
  font-size: 1rem;
  color: #333;
  transition: all 0.3s ease;
}

/* 悬停时的样式 */
:deep(.el-menu-item:hover) {
  background-color: #f5f5f7;
  color: #2563eb;
}

/* 当前激活的菜单项样式 */
:deep(.el-menu-item.is-active) {
  background-color: #eef3fd;
  color: #2563eb;
  border-left: 3px solid #2563eb;
}

/* 调整 el-menu 的默认样式 */
:deep(.el-menu) {
  border-right: none;
}

/* 调整 el-menu 的子元素间距 */
:deep(.el-menu-item) {
  height: 60px;
  line-height: 60px;
}


}
</style>